package define

import (
	"XiangMu/models"
)

const (
	PDF_NAME   = "user.pdf"
	WORD_NAME  = "user.docx"
	EXCEL_PDF  = "excel.pdf"
	EXCEL_WORD = "excel.docx"
)

var Steps = map[int]string{
	1:  "第一步",
	2:  "第二步",
	3:  "第三步",
	4:  "第四步",
	5:  "第五步",
	6:  "第六步",
	7:  "第七步",
	8:  "第八步",
	9:  "第九步",
	10: "第十步",
	11: "第十一步",
	12: "第十二步",
	13: "第十三步",
	14: "第十四步",
	15: "第十五步",
	16: "第十六步",
	17: "第十七步",
	18: "第十八步",
	19: "第十九步",
	20: "第二十步",
	21: "第二十一步",
	22: "第二十二步",
	23: "第二十三步",
	24: "第二十四步",
	25: "第二十五步",
}

// NotStarted 未开始；InProgress 进行中；Completed 已完成
var step1 = models.Steps{
	TopText:    "第一步",
	StepId:     1,
	MiddleText: "递交入党申请书",
	BottomText: "InProgress",
}

var step2 = models.Steps{
	TopText:    "第二步",
	StepId:     2,
	MiddleText: "党组织派人谈话",
	BottomText: "NotStarted",
}

var step3 = models.Steps{
	TopText:    "第三步",
	StepId:     3,
	MiddleText: "推荐和确定入党积极分子",
	BottomText: "NotStarted",
}

var step4 = models.Steps{
	TopText:    "第四步",
	StepId:     4,
	MiddleText: "上级党委备案",
	BottomText: "NotStarted",
}

var step5 = models.Steps{
	TopText:    "第五步",
	StepId:     5,
	MiddleText: "指定培养联系人",
	BottomText: "NotStarted",
}

var step6 = models.Steps{
	TopText:    "第六步",
	StepId:     6,
	MiddleText: "培养教育考察",
	BottomText: "NotStarted",
}

var step7 = models.Steps{
	TopText:    "第七步",
	StepId:     7,
	MiddleText: "确认发展对象",
	BottomText: "NotStarted",
}

var step8 = models.Steps{
	TopText:    "第八步",
	StepId:     8,
	MiddleText: "报上级党委备案",
	BottomText: "NotStarted",
}

var step9 = models.Steps{
	TopText:    "第九步",
	StepId:     9,
	MiddleText: "确定入党介绍人",
	BottomText: "NotStarted",
}

var step10 = models.Steps{
	TopText:    "第十步",
	StepId:     10,
	MiddleText: "进行政治审查",
	BottomText: "NotStarted",
}

var step11 = models.Steps{
	TopText:    "第十一步",
	StepId:     11,
	MiddleText: "开展集中培训",
	BottomText: "NotStarted",
}

var step12 = models.Steps{
	TopText:    "第十二步",
	StepId:     12,
	MiddleText: "支部委员会审查",
	BottomText: "NotStarted",
}

var step13 = models.Steps{
	TopText:    "第十三步",
	StepId:     13,
	MiddleText: "上级党委预审",
	BottomText: "NotStarted",
}

var step14 = models.Steps{
	TopText:    "第十四步",
	StepId:     14,
	MiddleText: "填写入党志愿书",
	BottomText: "NotStarted",
}

var step15 = models.Steps{
	TopText:    "第十五步",
	StepId:     15,
	MiddleText: "支部大会讨论",
	BottomText: "NotStarted",
}

var step16 = models.Steps{
	TopText:    "第十六步",
	StepId:     16,
	MiddleText: "上级党委派人谈话",
	BottomText: "NotStarted",
}

var step17 = models.Steps{
	TopText:    "第十七步",
	StepId:     17,
	MiddleText: "上级党委审批",
	BottomText: "NotStarted",
}

var step18 = models.Steps{
	TopText:    "第十八步",
	StepId:     18,
	MiddleText: "再上一级党委组织部门备案",
	BottomText: "NotStarted",
}

var step19 = models.Steps{
	TopText:    "第十九步",
	StepId:     19,
	MiddleText: "编入党支部和党小组",
	BottomText: "NotStarted",
}

var step20 = models.Steps{
	TopText:    "第二十步",
	StepId:     20,
	MiddleText: "入党宣誓",
	BottomText: "NotStarted",
}

var step21 = models.Steps{
	TopText:    "第二十一步",
	StepId:     21,
	MiddleText: "继续教育考察",
	BottomText: "NotStarted",
}

var step22 = models.Steps{
	TopText:    "第二十二步",
	StepId:     22,
	MiddleText: "提出转正申请",
	BottomText: "NotStarted",
}

var step23 = models.Steps{
	TopText:    "第二十三步",
	StepId:     23,
	MiddleText: "支部大会讨论",
	BottomText: "NotStarted",
}

var step24 = models.Steps{
	TopText:    "第二十四步",
	StepId:     24,
	MiddleText: "上级党委审批",
	BottomText: "NotStarted",
}

var Status1 = models.Data{
	Title: "申请入党",
	StateCartData: []models.Steps{
		DeepCopyStep(step1), // 如果 step1 是全局变量，建议深拷贝
		DeepCopyStep(step2),
	},
}

var Status2 = models.Data{
	Title: "入党积极分子的确定和培养教育",
	StateCartData: []models.Steps{
		DeepCopyStep(step3),
		DeepCopyStep(step4),
		DeepCopyStep(step5),
		DeepCopyStep(step6),
	},
}
var Status3 = models.Data{
	Title: "发展对象的确定和考察",
	StateCartData: []models.Steps{
		DeepCopyStep(step7),
		DeepCopyStep(step8),
		DeepCopyStep(step9),
		DeepCopyStep(step10),
		DeepCopyStep(step11),
	},
}
var Status4 = models.Data{
	Title: "预备党员的接收",
	StateCartData: []models.Steps{
		DeepCopyStep(step12),
		DeepCopyStep(step13),
		DeepCopyStep(step14),
		DeepCopyStep(step15),
		DeepCopyStep(step16),
		DeepCopyStep(step17),
		DeepCopyStep(step18),
	},
}
var Status5 = models.Data{
	Title: "预备党员的教育考察和转正",
	StateCartData: []models.Steps{
		DeepCopyStep(step19),
		DeepCopyStep(step20),
		DeepCopyStep(step21),
		DeepCopyStep(step22),
		DeepCopyStep(step23),
		DeepCopyStep(step24),
	},
}
var StepToIndex = map[int]int{
	1:  0,
	2:  1,
	3:  0,
	4:  1,
	5:  2,
	6:  3,
	7:  0,
	8:  1,
	9:  2,
	10: 3,
	11: 4,
	12: 0,
	13: 1,
	14: 2,
	15: 3,
	16: 4,
	17: 5,
	18: 6,
	19: 0,
	20: 1,
	21: 2,
	22: 3,
	23: 4,
	24: 5,
}

func StepToStatus(step int) int {
	if 1 <= step && step <= 2 {
		return 0
	} else if 3 <= step && step <= 6 {
		return 1
	} else if 7 <= step && step <= 11 {
		return 2
	} else if 12 <= step && step <= 18 {
		return 3
	} else {
		return 4
	}
}

func DeepCopyStep(step models.Steps) models.Steps {
	return models.Steps{
		TopText:    step.TopText,
		StepId:     step.StepId,
		MiddleText: step.MiddleText,
		BottomText: step.BottomText,
	}
}

var Key = map[string]string{
	"1入党申请时间": "1-1",
	"1入党申请书接收人(单位、职务、签名)": "1-2",
	"2支部谈话时间":          "2-1",
	"2谈话人(单位、职务、签名)":   "2-2",
	"3支部确定入党积极分子时间":    "3-1",
	"3会议记录人":           "3-2",
	"3会议地点":            "3-3",
	"3会议主持人":           "3-4",
	"3群团组织推优情况":        "3-5",
	"3党支部意见":           "3-6",
	"3群团组织推优会议时间":      "3-7",
	"3人数":              "3-8",
	"3实到人数":            "3-9",
	"3应到人数":            "3-10",
	"3赞成人数":            "3-11",
	"3反对人数":            "3-12",
	"3弃权人数":            "3-13",
	"4党委备案时间":          "4-1",
	"5培养联系人1":          "5-1",
	"5单位及职位1":          "5-2",
	"5培养联系人2":          "5-3",
	"5单位及职位2":          "5-4",
	"6书面思想汇报时间1":       "6-1",
	"6书面思想汇报时间2":       "6-2",
	"6书面思想汇报时间3":       "6-3",
	"6书面思想汇报时间4":       "6-4",
	"6支部考察时间1":         "6-5",
	"6支部考察时间2":         "6-6",
	"6支部考察时间3":         "6-7",
	"6支部考察时间4":         "6-8",
	"6培养教育情况":          "6-9",
	"6考察情况":            "6-10",
	"7支部确定发展对象人选时间":    "7-1",
	"7公示起止时间":          "7-2",
	"7党总支审议时间":         "7-3",
	"8党委备案同意时间":        "8-1",
	"9入党介绍人1":          "9-1",
	"9单位及职务1":          "9-2",
	"9入党介绍人2":          "9-3",
	"9单位及职务2":          "9-4",
	"10政审是否合格":         "10-1",
	"10政审人(单位、职务、签名)":  "10-2",
	"11参加发展对象集中培训起止时间": "11-1",
	"11培训成绩":           "11-2",
	"12支部审查时间":         "12-1",
	"13党委预审时间":         "13-1",
	"14入党志愿书编号":        "14-1",
	"15支部大会会议时间":       "15-1",
	"15有表决权党员人数":       "15-2",
	"15应到人数":           "15-3",
	"15实到人数":           "15-4",
	"15赞成票数":           "15-5",
	"15反对票数":           "15-6",
	"15弃权票数":           "15-7",
	"16党委派人谈话时间":       "16-1",
	"16谈话人(单位、职务、签名)":  "16-2",
	"17党委审批时间":         "17-1",
	"17党委委员人数":         "17-2",
	"17实到人数":           "17-3",
	"17同意人数":           "17-4",
	"17预备期起止时间":        "17-5",
	"18向上级党委组织部门备案时间":  "18-1",
	"19编入党支部名称":        "19-1",
	"20入党宣誓时间":         "20-1",
	"21继续教育考察":         "21-1",
	"22申请转正时间":         "22-1",
	"22转正公示起止时间":       "22-2",
	"23支部大会会议时间":       "23-1",
	"23有表决权党员人数":       "23-2",
	"23应到人数":           "23-3",
	"23实到人数":           "23-4",
	"23赞成票数":           "23-5",
	"23反对票数":           "23-6",
	"23弃权票数":           "23-7",
	"23会议决议":           "23-8",
	"24党委审批时间":         "24-1",
	"24党委委员人数":         "24-2",
	"24实到人数":           "24-3",
	"24同意人数":           "24-4",
	"24党龄起算时间":         "24-5",
	"24档案整理人(签名)":      "24-6",
}
var Default = map[string]map[string]string{
	"1":  {"入党申请书接收人(单位、职务、签名)": "人工智能学院XXXX党支部 党支部书记  李四（本人签字）", "入党申请时间": ""},
	"2":  {"支部谈话时间": "", "谈话人(单位、职务、签名)": "人工智能学院XXXX党支部 支部书记（副书记/组织委员等） 王五（本人签字）"},
	"3":  {"会议主持人": "", "会议地点": "", "会议记录人": "", "党支部意见": "支部委员会于××××年××月××日研究决定，同意把×××同志确定为入党积极分子。指定×××和×××为培养联系人。", "支部确定入党积极分子时间": "", "群团组织推优情况": "经XXX团支部民主评议和票决，并经人工智能学院团委备案同意，推荐为入党积极分子人选。"},
	"4":  {"党委备案时间": ""},
	"5":  {"单位及职位1": "人工智能学院XXXX党支部  党支部书记/党员", "单位及职位2": "人工智能学院XXXX党支部  组织委员/党员", "培养联系人1": "", "培养联系人2": ""},
	"6":  {"书面思想汇报时间1": "", "书面思想汇报时间2": "", "书面思想汇报时间3": "", "书面思想汇报时间4": "", "培养教育情况": "", "支部考察时间1": "", "支部考察时间2": "", "支部考察时间3": "", "支部考察时间4": "", "考察情况": ""},
	"7":  {"支部确定发展对象人选时间": "", "公示起止时间": ""},
	"8":  {"党委备案同意时间": ""},
	"9":  {"入党介绍人1": "", "单位及职务1": "人工智能学院XXXX党支部  党支部书记/党员", "入党介绍人2": "", "单位及职务2": "人工智能学院XXXX党支部  组织委员/党员"},
	"10": {"政审是否合格": "", "政审人(单位、职务、签名)": ""},
	"11": {"参加发展对象集中培训起止时间": "", "培训成绩": ""},
	"12": {"支部审查时间": ""},
	"13": {"党委预审时间": ""},
	"14": {"入党志愿书编号": ""},
	"15": {"支部大会会议时间": "", "有表决权党员人数": "", "应到人数": "", "实到人数": "", "赞成票数": "", "反对票数": "", "弃权票数": ""},
	"16": {"党委派人谈话时间": "", "谈话人(单位、职务、签名)": ""},
	"17": {"党委审批时间": "", "党委委员人数": "", "实到人数": "", "同意人数": "", "预备期起止时间": ""},
	"18": {"向上级党委组织部门备案时间": ""},
	"19": {"编入党支部名称": ""},
	"20": {"入党宣誓时间": ""},
	"21": {"继续教育考察": "（例文：××××年××月××日，组织×××同志听×××同志讲的党课，题目为×××××××。××××年××月××日，组织×××同志参加×××培训班，学习××××等课程。××××年××月××日，组织×××同志参加党员大会。n××××年××月××日，组织×××同志参加年度组织生活会和民主评议党员。××××年××月××日，党支部书记×××同志与×××同志谈心谈话，了解其有关情况。）"},
	"22": {"申请转正时间": "", "转正公示起止时间": ""},
	"23": {"支部大会会议时间": "", "有表决权党员人数": "", "应到人数": "", "实到人数": "", "赞成票数": "", "反对票数": "", "弃权票数": "", "会议决议": ""},
	"24": {"党委审批时间": "", "党委委员人数": "", "实到人数": "", "同意人数": "", "党龄起算时间": "", "档案整理人(签名)": ""},
}
